package com.boodaba.todocarts.infstr;

import com.db4o.query.Predicate;

@SuppressWarnings("serial")
public class PredicatedSpecificationFor<T> extends Predicate<T> {

	private ISpecification<T> mSpec;
	
	public PredicatedSpecificationFor() {}
	public PredicatedSpecificationFor(ISpecification<T> spec) {
		setSpecificationFor(spec);
	}
	
	public void setSpecificationFor(ISpecification<T> spec) {
		mSpec = spec;
	}

	@Override
	public boolean match(T arg0) {
		return mSpec.isSatisfiedBy(arg0);
	}

}
